<?php
namespace app\pub;

class ErrJson {
    public static function error_json($msg = ''){
        $ret = array('code' => 1001, 'msg' => $msg);
        exit(json_encode($ret));
    }

    public static function success_json($date){
        $ret = array('code' => 0, 'data' => $date);
        exit(json_encode($ret));
    }

    public static function result_json($code = 0, $msg = '', $date = ''){
        $ret = array('code' => $code, 'msg' => $msg, 'data' => $date);
        exit(json_encode($ret));
    }
}

